#ifndef SETTINGS_H
#define SETTINGS_H

#include <QObject>
#include <QString>
#include <QFont>
#include <QDir>
#include <QMap>
#include "Include/ITheme.h"
#include "Include/IEditors.h"

namespace Plugins
{
class Settings: public QObject
{
    Q_OBJECT
public:
    static Settings* instance();
    virtual ~Settings();

    QString lastUsedWorkspace();
    void setLastUsedWorkspace(const QString & workspace);

    QString lastOpenedProject();
    void setLastOpenedProject(const QString & project);

    QStringList recentProjects();
    void addRecentProjects(const QString & project);

    QString currentThemeName();
    void setCurrentThemeName(const QString& themeName);
    ITheme * currentTheme();
    ITheme * themeByName(const QString & themeName);
    ITheme * fallbackTheme();
    QString themesPath();

    QFont font();
    void setFont(const QFont& fnt);

    QFont monoFont();
    void setMonoFont(const QFont& fnt);

    bool restoreProject();
    void setRestoreProject(bool restore);
    bool restoreFiles();
    void setRestoreFiles(bool restore);

    QString py3();
    void setPy3(const QString & path);

    QString py2();
    void setPy2(const QString & path);

    QString pyuic4();
    void setPyuic4(const QString & path);

    void showPreferences(QWidget * parent);
    IEditors::EditorType getTypeByExtension(const QString & fileName);

    QList<QString> themesList();

    void setThemeChanged();
private slots:
    void closeSettings();
signals:
    void themeChanged();
private:
    Settings();
    Settings(const Settings &);
    Settings& operator=(const Settings &);
    static Settings* _instance;
    QDir _themesPath;
    QMap<QString, ITheme *> _themes;
};

}
#endif // SETTINGS_H
